Skip to main content
POST
/
public
/
v1
/
toptimize
/
forecasting
/
campaign
[BETA] Campaign-level Forecasts
curl --request POST \
  --url https://api.topsort.com/public/v1/toptimize/forecasting/campaign \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "timeWindow": 7,
  "targetRoas": 123,
  "budget": {
    "amount": 123,
    "type": "daily"
  },
  "campaignType": "autobidding",
  "bids": {
    "productIds": [
      "<string>"
    ],
    "inventory": []
  }
}'
[
  {
    "forecastDate": "2025-01-15",
    "metrics": [
      {
        "metricName": "impressions",
        "values": {
          "forecastValue": 5250,
          "forecastIntervalMin": 4900,
          "forecastIntervalMax": 5600
        }
      },
      {
        "metricName": "clicks",
        "values": {
          "forecastValue": 1050,
          "forecastIntervalMin": 980,
          "forecastIntervalMax": 1120
        }
      },
      {
        "metricName": "purchases",
        "values": {
          "forecastValue": 105,
          "forecastIntervalMin": 98,
          "forecastIntervalMax": 112
        }
      }
    ]
  },
  {
    "forecastDate": "2025-01-16",
    "metrics": [
      {
        "metricName": "impressions",
        "values": {
          "forecastValue": 5400,
          "forecastIntervalMin": 5050,
          "forecastIntervalMax": 5750
        }
      },
      {
        "metricName": "clicks",
        "values": {
          "forecastValue": 1080,
          "forecastIntervalMin": 1010,
          "forecastIntervalMax": 1150
        }
      },
      {
        "metricName": "purchases",
        "values": {
          "forecastValue": 108,
          "forecastIntervalMin": 101,
          "forecastIntervalMax": 115
        }
      }
    ]
  }
]

Authorizations

Authorization
string
header
required

A valid API key generated in Topsort's UI.

Body

application/json

Request model for campaign forecasts with the new structure.

targetRoas
number
required

Target Return on Ad Spend for the campaign

Required range: x > 0
budget
object
required

Campaign budget information

bids
object
required

Bid targets information

timeWindow
integer
default:7

How many days to forecast into the future

Required range: 1 <= x <= 14
campaignType
enum<string>

Campaign type (For v1, only autobidding is supported)

Available options:
autobidding

Response

Successful Response

forecastDate
string<date>
required

Date of the forecast

metrics
MetricForecast · object[]
required

List of metric forecasts for this date